<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:output method="html"/>

	<xsl:param name="username"/><!--marius</xsl:param>-->

	<xsl:template match="/">
		<xsl:apply-templates select="agenda/contact"/>
	</xsl:template>

	<xsl:template match="contact">
		<xsl:variable name="usr" select="@username"/>
		<xsl:if test="$usr=$username">
			<xsl:variable name="count">
				<xsl:value-of select="count(friends/friend)"/>
			</xsl:variable>
			<tr id="chatPersonal" onclick="hideElements(this.id, 'anunturi')">
				<td class="caption">Personal</td>
				<input type="hidden" id="chatPersonalNrElems" value="{$count}"/>
			</tr>

			<xsl:variable name="contor" select="count(friends/friend)"/>
			<xsl:for-each select="friends/friend">
				<xsl:variable name="friendName" select="text()"/>
				<xsl:choose>
					<xsl:when test="position()=$contor">
						<tr class="hidden">
							<td class="last add">
								<a href="#">
									<xsl:value-of select="$friendName"/>
								</a>
							</td>
						</tr>
					</xsl:when>
					<xsl:otherwise>
						<tr class="hidden">
							<td class="add">
								<a href="#">
									<xsl:value-of select="$friendName"/>
								</a>
							</td>
						</tr>
					</xsl:otherwise>
				</xsl:choose>
			</xsl:for-each>
		</xsl:if>
	</xsl:template>
</xsl:stylesheet><!-- Stylus Studio meta-information - (c) 2004-2006. Progress Software Corporation. All rights reserved.
<metaInformation>
<scenarios ><scenario default="yes" name="Scenario1" userelativepaths="yes" externalpreview="no" url="..\..\xmlDb\agenda.xml" htmlbaseurl="" outputurl="" processortype="internal" useresolver="yes" profilemode="0" profiledepth="" profilelength="" urlprofilexml="" commandline="" additionalpath="" additionalclasspath="" postprocessortype="none" postprocesscommandline="" postprocessadditionalpath="" postprocessgeneratedext="" validateoutput="no" validator="internal" customvalidator=""/></scenarios><MapperMetaTag><MapperInfo srcSchemaPathIsRelative="yes" srcSchemaInterpretAsXML="no" destSchemaPath="" destSchemaRoot="" destSchemaPathIsRelative="yes" destSchemaInterpretAsXML="no" ><SourceSchema srcSchemaPath="..\..\xmlDb\agenda.xml" srcSchemaRoot="agenda" AssociatedInstance="" loaderFunction="document" loaderFunctionUsesURI="no"/></MapperInfo><MapperBlockPosition><template match="/"></template><template match="contact"></template></MapperBlockPosition><TemplateContext></TemplateContext><MapperFilter side="source"></MapperFilter></MapperMetaTag>
</metaInformation>
-->